/* ---------------------------------------------------------------------- */
/* Script generated with: DeZign for Databases v6.0.0                     */
/* Target DBMS:           MS SQL Server 2005                              */
/* Project file:          official_db_scheme.dez                          */
/* Project name:                                                          */
/* Author:                                                                */
/* Script type:           Database drop script                            */
/* Created on:            2010-01-22 03:51                                */
/* ---------------------------------------------------------------------- */


/* ---------------------------------------------------------------------- */
/* Drop foreign key constraints                                           */
/* ---------------------------------------------------------------------- */

ALTER TABLE [project] DROP CONSTRAINT [user_project]
GO

ALTER TABLE [milestone] DROP CONSTRAINT [project_milestone]
GO

ALTER TABLE [work_on] DROP CONSTRAINT [user_work_on]
GO

ALTER TABLE [work_on] DROP CONSTRAINT [project_work_on]
GO

ALTER TABLE [phase] DROP CONSTRAINT [milestone_phase]
GO

ALTER TABLE [task] DROP CONSTRAINT [phase_task]
GO

ALTER TABLE [assign] DROP CONSTRAINT [user_assign]
GO

ALTER TABLE [assign] DROP CONSTRAINT [task_assign]
GO

ALTER TABLE [documentation] DROP CONSTRAINT [user_documentation]
GO

ALTER TABLE [documentation] DROP CONSTRAINT [folder_documentation]
GO

ALTER TABLE [folder] DROP CONSTRAINT [project_folder]
GO

/* ---------------------------------------------------------------------- */
/* Drop table "documentation"                                             */
/* ---------------------------------------------------------------------- */

/* Drop constraints */

ALTER TABLE [documentation] DROP CONSTRAINT [DEF_documentation_documentation_status]
GO

ALTER TABLE [documentation] DROP CONSTRAINT [PK_documentation]
GO

/* Drop table */

EXECUTE sp_dropextendedproperty N'MS_Description', 'SCHEMA', N'dbo', 'TABLE', N'documentation', 'COLUMN', N'documentation_status'
GO

DROP TABLE [documentation]
GO

/* ---------------------------------------------------------------------- */
/* Drop table "folder"                                                    */
/* ---------------------------------------------------------------------- */

/* Drop constraints */

ALTER TABLE [folder] DROP CONSTRAINT [PK_folder]
GO

/* Drop table */

DROP TABLE [folder]
GO

/* ---------------------------------------------------------------------- */
/* Drop table "assign"                                                    */
/* ---------------------------------------------------------------------- */

/* Drop constraints */

ALTER TABLE [assign] DROP CONSTRAINT [PK_assign]
GO

/* Drop table */

DROP TABLE [assign]
GO

/* ---------------------------------------------------------------------- */
/* Drop table "task"                                                      */
/* ---------------------------------------------------------------------- */

/* Drop constraints */

ALTER TABLE [task] DROP CONSTRAINT [DEF_task_task_status]
GO

ALTER TABLE [task] DROP CONSTRAINT [PK_task]
GO

/* Drop table */

EXECUTE sp_dropextendedproperty N'MS_Description', 'SCHEMA', N'dbo', 'TABLE', N'task', 'COLUMN', N'task_status'
GO

DROP TABLE [task]
GO

/* ---------------------------------------------------------------------- */
/* Drop table "phase"                                                     */
/* ---------------------------------------------------------------------- */

/* Drop constraints */

ALTER TABLE [phase] DROP CONSTRAINT [PK_phase]
GO

/* Drop table */

DROP TABLE [phase]
GO

/* ---------------------------------------------------------------------- */
/* Drop table "work_on"                                                   */
/* ---------------------------------------------------------------------- */

/* Drop constraints */

ALTER TABLE [work_on] DROP CONSTRAINT [DEF_work_on_role]
GO

ALTER TABLE [work_on] DROP CONSTRAINT [PK_work_on]
GO

/* Drop table */

EXECUTE sp_dropextendedproperty N'MS_Description', 'SCHEMA', N'dbo', 'TABLE', N'work_on', 'COLUMN', N'role'
GO

DROP TABLE [work_on]
GO

/* ---------------------------------------------------------------------- */
/* Drop table "milestone"                                                 */
/* ---------------------------------------------------------------------- */

/* Drop constraints */

ALTER TABLE [milestone] DROP CONSTRAINT [PK_milestone]
GO

/* Drop table */

DROP TABLE [milestone]
GO

/* ---------------------------------------------------------------------- */
/* Drop table "project"                                                   */
/* ---------------------------------------------------------------------- */

/* Drop constraints */

ALTER TABLE [project] DROP CONSTRAINT [PK_project]
GO

/* Drop table */

DROP TABLE [project]
GO

/* ---------------------------------------------------------------------- */
/* Drop table "[user]"                                                    */
/* ---------------------------------------------------------------------- */

/* Drop constraints */

ALTER TABLE [user] DROP CONSTRAINT [DEF_user_user_sex]
GO

ALTER TABLE [user] DROP CONSTRAINT [PK_user]
GO

/* Drop table */

DROP TABLE [user]
GO
